﻿using Cl.Entity.BaseEntity;
using Cl.Utils.Primitives.Enum;
using SqlSugar;
using System.ComponentModel.DataAnnotations.Schema;

namespace Cl.Entity.DataBaseEntity.User
{
    [SugarTable("User_Permission")]
    public class Permission : EntityBaseComplete
    {
        /// <summary>
        /// 父级节点
        /// </summary>
        public int? ParentId { get; set; }

        /// <summary>
        /// 权限名称
        /// </summary>
        public string Label { get; set; }

        /// <summary>
        /// 权限编码
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(500)")]
        public string Code { get; set; }

        public PermissionType Type { get; set; }

        /// <summary>
        /// 视图Id
        /// </summary>
        public int? ViewId { get; set; }

        /// <summary>
        /// 路由命名
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)")]
        public string Name { get; set; }

        /// <summary>
        /// 路由地址
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(500)")]
        public string Path { get; set; }

        /// <summary>
        /// 重定向地址
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(500)")]
        public string Redirect { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(100)")]
        public string Icon { get; set; }

        /// <summary>
        /// 隐藏
        /// </summary>
        public bool Hidden { get; set; } = false;

        /// <summary>
        /// 展开分组
        /// </summary>
        public bool Opened { get; set; }

        /// <summary>
        /// 打开新窗口
        /// </summary>
        public bool NewWindow { get; set; } = false;



        /// <summary>
        /// 是否固定
        /// </summary>
        public bool IsAffix { get; set; } = false;

        /// <summary>
        /// 链接地址
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(500)")]
        public string Link { get; set; }

        /// <summary>
        /// 是否内嵌窗口
        /// </summary>
        public bool IsIframe { get; set; } = false;

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(200)")]
        public string Description { get; set; }

        /// <summary>
        /// 启用
        /// </summary>
        public bool Enabled { get; set; } = true;

    }
}
